<template>
    <view>
        <custom><template #backText>更新应用</template></custom>
        <nBar title="更新日志"></nBar>
        <view class="cu-list menu">
            <nMenuItemRow2 v-for="(info, key) in upgrade_list" :top_title="info.upgrade_remark" :bottom_title="info.version_no"></nMenuItemRow2>
        </view>
        <foot title="复制地址, 自行粘贴至浏览器下载" :tap="copyBtn" style_foot="bottom:100rpx"></foot>
        <foot title="立即下载" :tap="downloadBtn" class_bg="bg-deep-nddyny"></foot>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                dialog: {
                    show: true,
                },
                upgrade_list: this.$app.upgrade_list
            }
        },
        methods: {
            downloadBtn() {
                if (this.upgrade_list[0].app_url) {
                    plus.runtime.openURL(this.upgrade_list[0].app_url);
                }
            },
            copyBtn() {
                if (this.upgrade_list[0].app_url) {
                    uni.setClipboardData({
                        data: this.upgrade_list[0].app_url,
                        success: () => {
                            this.$store.commit('userToastSuccess', '复制成功');
                        }
                    });
                }
            }
        }
    }
</script>
